package com.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.domain.WorkOrder;
import com.service.WorkOrderService;

@Controller
@RequestMapping("/")
public class WorkOrderController {
	@Autowired
	private WorkOrderService workOrderService;
	
	@RequestMapping("showAllOrders")
	public String showNames(ModelMap mm) {
		List<WorkOrder> orderList = workOrderService.getAllOrders();

		mm.addAttribute("orderList",orderList);

		return "workOrder/workOrderList";
	}
}
